package com.xixisleep.apiinterface.controller;

import com.xixisleep.yeapiclientsdk.model.User;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import java.util.HashMap;

import static com.xixisleep.yeapiclientsdk.utils.SignUtils.generateSign;

/**
 * 名字api
 */
@RestController
@RequestMapping("/name")
public class NameController {

    @GetMapping("/getName")
    public String getNameByGet(String name){
        return "GET 你的名字是" + name;
    }

    @PostMapping("/username")
    public String getUserNameByPost(@RequestBody User user, HttpServletRequest request){
        String result = "POST 用户名字是" + user.getUsername();
        return result;
    }

    @PostMapping("/postName")
    public String getNameByPost(@RequestParam String name){
        return "POST 你的名字是" + name;
    }
}
